package com.os.core.common;

public enum ResultCode {

    //-----------系统返回码---------------
    //成功返回结果
    SERVICE_OK(10000,"成功！"),
    //返回失败结果
    SERVICE_ERR(10001,"失败！"),
    ACCESS_ERROR(10002, "权限不足！"),
    USER_NO_LOGIN(10003, "您还未登录！"),

    SERVER_ERROR(99999, "抱歉，系统繁忙，请稍后重试！"),

    //-----------用户操作返回码---------------
    USER_FAIL(20001, "用户名或密码错误！"),
    TOKEN_GENERATOR_ERROR(20002, "token生成失败！"),
    TOKEN_INVALID(20003, "token不合法！"),

    SQL_ILLEGAL(20009, "sql非法！"),

    NO_RECORDS(30001, "无数据返回"),
    NULL_ERR(30002, "不能为空"),
    DUPLICATE_ERR(30003, "数据已经存在"),

    //-----------自定义公式返回码---------------
    FUNCTION_ERR(40001,"公式错误")
    ;


    //-----------根据具体业务配置---------------



    private String msg;

    private int code;

    ResultCode(int code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public int getCode() {
        return code;
    }
}
